/* 个人中心的接口 */
import {
  getAction,
  postAction,
  putAction,
  deleteAction,
  httpAction,
} from "../utils/request.js";

// 个人信息-------------------------------------
const miniUserEdit = (params) => postAction("/mini/user/edit", params);

// 我的餐厅-------------------------------------
const restaurantPage = (params) => getAction("/mini/restaurant/page", params);

// 获取验证码
const restaurantSendsms = (params) =>
  postAction("/mini/restaurant/send_sms", params);

// 营业地址
const regionTree = (params) => getAction("/mini/sys/region/tree", params);

// 根据灶头数  回显信息
const restaurantStovenum = (params) =>
  getAction("/mini/restaurant/stove_num", params);

// 添加/重新提交餐厅
const restaurantSave = (params) => postAction("/mini/restaurant/save", params);

// 我的餐厅 -- 详情
const restaurantDetail = (params) =>
  getAction("/mini/restaurant/detail", params);

// 我的餐厅 -- 更换绑定 -- 新的绑定人手机号  调用的接口
const findMiniName = (mobile) =>
  getAction(`/mini/sys/operate/find_mini_name?mobile=${mobile}`);

// 我的餐厅 -- 更换绑定
const restaurantChangeuser = (params) =>
  postAction("/mini/restaurant/change_user", params);

// 删除餐厅
const restaurantDelete = (id) =>
  deleteAction(`/mini/restaurant/delete?id=${id}`);

// 获取餐厅
const restaurantList = (params) => getAction("/mini/restaurant/list", params);

// 清洗合同-------------------------------------
// 清洗合同列表
const cleancontractPage = (params) =>
  getAction("/mini/restaurant/clean_contract/page", params);

// 添加清洗合同
const cleancontractCreate = (params) =>
  postAction("/mini/restaurant/clean_contract/create", params);

// 第三方检测报告-------------------------------------
// 列表
const thirdpartyreportPage = (params) =>
  getAction("/mini/restaurant/third_party_report/page", params);

// 新增
const thirdpartyreportCreate = (params) =>
  postAction("/mini/restaurant/third_party_report/create", params);

export {
  miniUserEdit,
  restaurantPage,
  restaurantSendsms,
  regionTree,
  restaurantStovenum,
  restaurantSave,
  restaurantDetail,
  findMiniName,
  restaurantChangeuser,
  restaurantDelete,
  restaurantList,
  cleancontractPage,
  cleancontractCreate,
  thirdpartyreportPage,
  thirdpartyreportCreate,
};
